﻿using System.Web.Optimization;

namespace Quadrant.web
{
    public class BundleConfig
    {
        public static void RegisterBundles(BundleCollection bundles)
        {
            bundles.UseCdn = true;   //enable CDN support
#if !DEBUG
            BundleTable.EnableOptimizations = true;
#endif

            //add link to jquery on the CDN
            const string jqueryCdnPath = "http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js";
            const string bootstrapCdnPath = "http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js";

            bundles.Add(new ScriptBundle("~/bundles/jquery", jqueryCdnPath)
                        .Include("~/Scripts/jquery-{version}.js"));

            bundles.Add(new ScriptBundle("~/bundles/jqueryval").
                Include("~/Scripts/jquery.validate*"));

            bundles.Add(new ScriptBundle("~/bundles/bts", bootstrapCdnPath)
                   .Include("~/Scripts/bootstrap.js"));

            bundles.Add(new ScriptBundle("~/bundles/welcome")
                        .Include("~/Scripts/smoothscroll.js")
                        .Include("~/Scripts/classie.js")
                        .Include("~/Scripts/welcome.js"));

            bundles.Add(new ScriptBundle("~/bundles/modernizr")
                     .Include("~/Scripts/modernizr-*")
                     .Include("~/Scripts/fixIe10mobil.js"));

            bundles.Add(new ScriptBundle("~/bundles/app").Include(
                      //"~/Scripts/bootstrap.js",
                      //"~/Scripts/respond.js",
                      "~/Scripts/moment-with-langs.js",
                      "~/Scripts/toastr.js",
                      "~/Scripts/handlebars.js",
                //"~/Scripts/jquery-draggable.js",
                      "~/Scripts/stringExt.js",
                      "~/Scripts/ts/base.js",
                      "~/Scripts/ts/helpers.js"));

            bundles.Add(new StyleBundle("~/Content/css")
                   .Include("~/Content/app.css")
                    .Include("~/Content/site.css"));

            bundles.Add(new StyleBundle("~/Content/welcome")
                  .Include("~/Content/app.css")
                  .Include("~/Content/welcome.css"));
        }
    }
}
